<?php
/**
 * ============================================================================
 * Copyright (c) 2015-2019 贵州大师兄信息技术有限公司 All rights reserved.
 * siteַ: http://www.dsxcms.com
 * ============================================================================
 * @author:     David Song<songdewei@163.com>
 * @version:    v1.0.0
 * ---------------------------------------------
 * Date: 2019-06-04
 * Time: 19:45
 */

//卖家中心
Route::group(['namespace' => 'Seller', 'prefix' => 'seller', 'middleware' => 'auth'], function () {
    Route::get('/', 'IndexController@index');
    Route::get('shop', 'ShopController@index');
    Route::post('shop', 'ShopController@store');
    //用户认证
    Route::get('auth', 'AuthController@index');
    Route::post('auth', 'AuthController@store');
    Route::get('profile', 'ProfileController@index');
    Route::get('profile/edit', 'ProfileController@edit');
    Route::post('profile/edit', 'ProfileController@storeAuth');
    Route::get('sender', 'SenderController@index');
    Route::get('sender/newsender', 'SenderController@newSender');
    Route::post('sender/newsender', 'SenderController@storeSender');
    Route::post('sender/delete', 'SenderController@delete');
    Route::get('kefu', 'KefuController@index');
    Route::post('kefu', 'KefuController@delete');
    Route::get('kefu/qrcode', 'KefuController@qrcode');
    Route::post('kefu/toggle', 'KefuController@toggle');
    //item
    Route::get('item', 'ItemController@index');
    Route::get('item/publish', 'ItemController@publish');
    Route::post('item/publish', 'ItemController@store');
    Route::post('item/delete', 'ItemController@delete');
    Route::post('item/batchupdate', 'ItemController@batchUpdate');
    Route::post('item/updatecatlog', 'ItemController@updateCatlog');
    Route::get('item/getprops', 'ItemController@getProps');
    Route::get('item/savesuccess', 'ItemController@itemSaveSuccess');
    Route::get('item/app_code', 'ItemController@appCode');
    Route::get('catlog', 'CatlogController@index');
    Route::post('catlog/save', 'CatlogController@store');
    Route::get('catlog/getcatloglist', 'CatlogController@getCatlogList');
    Route::get('catlog/delete', 'CatlogController@delete');
    Route::get('catlog/changetotop', 'CatlogController@changeToTop');
    Route::get('catlog/items', 'CatlogController@items');
    Route::post('catlog/cancel', 'CatlogController@cancel');
    //sold
    Route::get('sold', 'SoldController@index');
    Route::get('sold/export', 'SoldController@export');
    Route::get('wuliu/detail', 'WuliuController@detail');
    //
    Route::get('attribute/showattributes', 'AttributeController@showAttributes');
    Route::get('attribute/getattributes', 'AttributeController@getAttributes');
    Route::get('attribute/getvalues', 'AttributeController@getValues');
    Route::post('attribute/saveattribute', 'AttributeController@saveAttribute');
    Route::post('attribute/savevalue', 'AttributeController@saveValue');
    //运费模板
    Route::get('freight', 'FreightController@index');
    Route::get('freight/newtemplate', 'FreightController@newTemplate');
    Route::post('freight/newtemplate', 'FreightController@store');
    Route::post('freight/delete', 'FreightController@delete');
    //交易设置
    Route::get('deal', 'DealController@index');
    Route::get('deal/getshop', 'DealController@getShop');
    Route::get('deal/day', 'DealController@day');
    Route::post('deal/update', 'DealController@update');
});

Route::group(['namespace' => 'Trade', 'prefix' => 'trade', 'middleware' => 'auth'], function () {
    //bought
    Route::get('bought/detail', 'BoughtController@detail');
    Route::post('bought/confirm', 'BoughtController@confirm');
    Route::post('bought/delete', 'BoughtController@delete');
    Route::get('bought/close', 'BoughtController@showClose');
    Route::post('bought/close', 'BoughtController@close');
    Route::get('bought/refund', 'BoughtController@showRefund');
    Route::post('bought/refund', 'BoughtController@refund');
    //sold
    Route::get('sold/detail', 'SoldController@detail');
    Route::post('sold/send', 'SoldController@send');
});

//竞拍
Route::group(['namespace' => 'Auction', 'prefix' => 'auction', 'middleware' => 'auth'], function () {
    Route::post('buynow', 'AuctionController@buyNow');
    Route::post('createorder', 'AuctionController@createOrder');
    Route::post('confirmorder', 'AuctionController@confirmOrder');
    Route::post('settlement', 'AuctionController@settlement');
    Route::post('createorder', 'AuctionController@createOrder');
    Route::get('pay', 'PayController@index');
    Route::get('pay/alipay', 'PayController@alipay');
    Route::get('pay/alipay_query', 'PayController@alipayQuery');
    Route::get('pay/success', 'PayController@success');
});


Route::group(['namespace' => 'Mall'], function () {
    Route::get('shop', 'ShopController@showShops');
    Route::get('shop/viewshop/{shop_id}.html', 'ShopController@detail');

    Route::get('item/search', 'ItemController@showItems');
    Route::get('item/detail/{itemid}.html', 'ItemController@detail');
    Route::get('item/catlog', 'ItemController@catlog');

    Route::get('cart', 'CartController@index');
    Route::post('cart/add', 'CartController@add');
    Route::post('cart/delete', 'CartController@delete');
    Route::post('cart/update', 'CartController@updateQuantity');
});
